Public Enum ACPasos
   EpPICA = 80
   EpELITE = 77
End Enum

Public Enum ACFuentes
   Draft = 1
   Roman = 2
   Sans_Serif = 3
   Courier = 4
   Recibo = 5
End Enum

Public Enum ACAlineacion
   Izquierda = 0
   Centro = 1
   Derecha = 2
   Justificado = 3
End Enum

Public Enum ACInterEspaciado
   Ocho = 1
   Seis = 2
End Enum

Public Enum ACDrafts
   Draft10PCI = 0
   Draft12PCI = 1
   Draft15PCI = 2
   Draft20PCI = 3
End Enum

Public Class ACFuncImpresion
#Region " Variables "

   Private Const ESC = Chr(27)

#End Region

#Region " Funciones "
   Public Shared Function Alineacion(Optional ByVal x_alineacion As ACAlineacion = ACAlineacion.Izquierda) As String
      Alineacion = ESC & "a"
      Select Case x_alineacion
         Case ACAlineacion.Izquierda
            Alineacion = String.Format("{0}0", Alineacion)
         Case ACAlineacion.Centro
            Alineacion = String.Format("{0}1", Alineacion)
         Case ACAlineacion.Derecha
            Alineacion = String.Format("{0}2", Alineacion)
         Case ACAlineacion.Justificado
            Alineacion = String.Format("{0}3", Alineacion)
      End Select
   End Function

   Public Shared Function Condensado(Optional ByVal x_activado As Boolean = True) As String
      If x_activado Then
         Condensado = ESC & Chr(15) ' "SI"
      Else
         Condensado = ESC & Chr(18) '"DC2"
      End If
   End Function

   Public Shared Function DobleAncho(Optional ByVal x_activado As Boolean = True) As String
      If x_activado Then
         DobleAncho = ESC & Chr(87) ' "W1"
      Else
         DobleAncho = ESC & Chr(20) ' "W0"
      End If
   End Function

   Public Shared Function DoblePasada() As String
      DoblePasada = ESC & Chr(71)
   End Function

   Public Shared Function Exponente(Optional ByVal x_activado As Boolean = True) As String
      If x_activado Then
         Exponente = String.Format("{0}S0", ESC)
      Else
         Exponente = String.Format("{0}T", ESC)
      End If
   End Function

   Public Shared Function Fuente(Optional ByVal x_fuente As ACFuentes = ACFuentes.Draft) As String
      Select Case x_fuente
         Case ACFuentes.Draft
            Fuente = String.Format("{0}x0", ESC)
         Case ACFuentes.Roman
            Fuente = String.Format("{0}x1 {0}k0", ESC)
         Case ACFuentes.Sans_Serif
            Fuente = String.Format("{0}x1 {0}k1", ESC)
         Case ACFuentes.Courier
            Fuente = String.Format("{0}x1 {0}k2", ESC)
         Case ACFuentes.Recibo
            Fuente = Chr(18) + Chr(27) + Chr(71) + Chr(27) + Chr(67) + Chr(35)
         Case Else
            Fuente = String.Format("{0}x0", ESC)
      End Select
   End Function

   Public Shared Function FuenteDraft(Optional ByVal x_draft As ACDrafts = ACDrafts.Draft10PCI)
      Select Case x_draft
         Case ACDrafts.Draft10PCI
            FuenteDraft = ESC & Chr(80)
         Case ACDrafts.Draft12PCI
            FuenteDraft = ESC & Chr(77)
         Case ACDrafts.Draft15PCI
            FuenteDraft = ESC & Chr(103)
         Case ACDrafts.Draft20PCI
            FuenteDraft = ESC & Chr(112)
         Case Else
            FuenteDraft = ESC & Chr(80)
      End Select
   End Function

   Public Shared Function Interespaciado(Optional ByVal x_lineas As ACInterEspaciado = ACInterEspaciado.Seis) As String
      If x_lineas = ACInterEspaciado.Seis Then
         Interespaciado = String.Format("{0}2", ESC)
      Else
         Interespaciado = String.Format("{0}0", ESC)
      End If
   End Function

   Public Shared Function MargenDerecho(Optional ByVal x_espacios As Long = 0) As String
      MargenDerecho = ESC & "Q" & x_espacios
   End Function

   Public Shared Function MargenIzquierdo(Optional ByVal x_espacios As Long = 0) As String
      MargenIzquierdo = ESC & Chr(108) & x_espacios
   End Function

   Public Shared Function Negrita(Optional ByVal x_activado As Boolean = True) As String
      If x_activado Then
         Negrita = ESC & "E"
      Else
         Negrita = ESC & "F"
      End If
   End Function

   Public Shared Function NumeroLineas(ByVal x_lineas As Short) As String
      NumeroLineas = ESC & Chr(67) & Chr(x_lineas)
   End Function

   Public Shared Function SubIndice(Optional ByVal x_activado As Boolean = True) As String
      If x_activado Then
         SubIndice = ESC & "S1"
      Else
         SubIndice = ESC & "T"
      End If
   End Function

   Public Shared Function Paso(Optional ByVal x_paso As ACPasos = ACPasos.EpPICA) As String
      Paso = ESC & Chr(x_paso)
   End Function

   Public Shared Function SaltoLinea() As String
      SaltoLinea = Chr(13) & Chr(10)
   End Function

   Public Shared Function SaltoPagina() As String
      SaltoPagina = Chr(12)
   End Function

   Public Shared Function Subrayado(Optional ByVal x_activado As Boolean = True) As String
      If x_activado Then
         Subrayado = ESC & "-1"
      Else
         Subrayado = ESC & "-0"
      End If
   End Function

   Public Shared Function Tabulacion() As String
      Tabulacion = Chr(9)
   End Function

#End Region

End Class